package presenter.record;

import utils.FileBean;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 三星手机格式：Screen_Recording_20221001_190245_One UI Home.mp4
 * 最终格式：20220514-224144.mp4
 */
public class SamsungRecorder3Impl implements IRecorder {

    @Override
    public Pattern pattern() {
        return Pattern.compile("Screen_Recording_(\\d+)_(\\d+)_One UI Home.mp4");
    }

    @Override
    public String rename(FileBean bean, Matcher matcher) {
        String date = matcher.group(1);
        String time = matcher.group(2);
        String toName = String.format("%s-%s.mp4", date, time);
        return IRecorder.fixedPath(bean.parent(), toName);
    }
}
